<template>
  <div>
    <h2>谁使用的{{ name }}</h2>
    <p>他的爱好是</p>
    <ul>
      <li v-for="item in list" :key="item">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Tab",
  props: ["name", "id"],
  computed: {
    list() {
      switch (this.id) {
        case 1:
          return ["唱", "跳", "Rap", "篮球"];
        case 2:
          return ["吃", "喝", "玩", "乐"];
        default:
          return [];
      }
    },
  },
};
</script>

<style>
</style>